# # -*- coding:utf-8 -*-
# import threading
# import copy
# from common.data import DB
#
# from utils.read_write_case import write_case
#
# _init_case_data = {"cases": []}
#
#
# class UpdateDB:
#     instance = None
#     lock = threading.RLock()
#
#     def __new__(cls, *args, **kwargs):
#         if cls.instance:
#             return cls.instance
#
#         with cls.lock:
#             cls.instance = object.__new__(cls)
#             return cls.instance
#
#     @classmethod
#     def start_record(cls):
#         DB.isRecord = True
#         DB.caseData = copy.deepcopy(_init_case_data)
#
#     @classmethod
#     def stop_record(cls):
#         DB.isRecord = False
#         print(DB.case_task_name)
#         print(DB.caseData)
#         # cls.caseData = copy.deepcopy(_init_case_data)
#         write_case(DB.caseData)
